interface Named {
  name: string
}
let x : Named
let y = {name: 'Alice', location: 'Seattle'}
x = y
// 检查函数参数时候使用相同的规则
function greet (n : Named) {
  console.log(n.name)
}
greet(y) // Alice